package com.yuan.task.interceptor;

import cn.common.exception.BusinessException;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.Map;

@Slf4j
@Component
public class CustomFeignInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
//        Map<String, Collection<String>> headers = requestTemplate.headers();
//        log.info(" 当前请求头: {}", headers);
        //修改请求的url
        //log.info("拦截器CustomFeignInterceptor"+requestTemplate.uri("/list1"));
        //throw new BusinessException("拦截成功");

    }
}
